<? if( $_SESSION[ "JC_account_authority" ] ) { ?>

	<? $JC_page = JC_page( ); ?>

	<table>

		<tr>
			<th colspan="2">	Search	</th>
			<th>				Key		</th>
			<th>				Omit	</th>
			<th colspan="2">	Order	</th>
			<th>				Page	</th>
			<th>				Limit	</th>
			<th>				Select	</th>

			<? if( $_REQUEST[ "JC_mode" ] == "select" ) { ?><th>Excel</th><? } ?>

		</tr>

		<tr>


			<td>
				<input
					type	= "text"
					value	= "<?= $_SESSION[ "JC_filter_ST_" . $_REQUEST[ "JC_table" ] ] ?>"
					size	= "12"
					onclick	= "this.select( );"
					onblur	= "JC_session( 'JC_filter_ST_<?= $_REQUEST[ "JC_table" ] ?>', this.value );"
				/>
			</td>
			<td>

				<? foreach( $_SESSION[ "JC_scheme" ][ $_REQUEST[ "JC_table" ] ] as $key => $value ) { ?>

					<? if( $key == "comment" ) continue; ?>

					<input
						type	= "checkbox"
						onclick	= "JC_session( 'JC_filter_SF_<?= $_REQUEST[ "JC_table" ] ?>.<?= $key ?>', this.value );"
						<?= $_SESSION[ "JC_filter_SF_" . $_REQUEST[ "JC_table" ] . "." . $key ] ? "checked" : "" ?>
					/> <?= ucwords( $key ) ?><br class="form" />

				<? } ?>

			</td>

			<td>
				<input
					type	= "text"
					value	= "<?= $_SESSION[ "JC_filter_KS_" . $_REQUEST[ "JC_table" ] ] ?>"
					size	= "6"
					title	= "If you input '0' in this, this will change to the minimum value."
					class	= "right"
					onclick	= "this.select( );"
					onblur	= "JC_session( 'JC_filter_KS_<?= $_REQUEST[ "JC_table" ] ?>', this.value );"
				/> ~
				<input
					type	= "text"
					value	= "<?= $_SESSION[ "JC_filter_KE_" . $_REQUEST[ "JC_table" ] ] ?>"
					size	= "6"
					title	= "If you input '0' in this, this will change to the maximum value."
					class	= "right"
					onclick	= "this.select( );"
					onblur	= "JC_session( 'JC_filter_KE_<?= $_REQUEST[ "JC_table" ] ?>', this.value );"
				/>
			</td>
			<td>

				<? foreach( $_SESSION[ "JC_scheme" ][ $_REQUEST[ "JC_table" ] ] as $key => $value ) { ?>

					<? if( $key == "comment" ) continue; ?>

					<input
						type	= "checkbox"

						<? if( $key == "delete"	) { ?>

							title	= "If you check this, every deleted record will be hidden."
							class	= "help"

						<? } ?>

						onclick	= "JC_session( 'JC_filter_omit_<?= $_REQUEST[ "JC_table" ] ?>.<?= $key ?>', this.value );"
						<?= $_SESSION[ "JC_filter_omit_" . $_REQUEST[ "JC_table" ] . "." . $key ] ? "checked" : "" ?>
					/>
					
					<?= ucwords( $key ) ?><br class="form" />

				<? } ?>

			</td>
			<td>

				<? foreach( $_SESSION[ "JC_scheme" ][ $_REQUEST[ "JC_table" ] ] as $key => $value ) { ?>

					<? if( $key == "comment" ) continue; ?>

					<input
						type	= "radio"
						name	= "JC_filter_OF"
						value	= "<?= $key ?>"
						onclick	= "JC_session( 'JC_filter_OF_<?= $_REQUEST[ "JC_table" ] ?>', this.value );"
						<?= $_SESSION[ "JC_filter_OF_" . $_REQUEST[ "JC_table" ] ] == $key ? "checked" : "" ?>
					/> <?= ucwords( $key ) ?><br class="form" />

				<? } ?>

			</td>
			<td>

				<input
					type	= "radio"
					name	= "JC_filter_OT"
					value	= "ASC"
					onclick	= "JC_session( 'JC_filter_OT_<?= $_REQUEST[ "JC_table" ] ?>', this.value );"
					<?= $_SESSION[ "JC_filter_OT_" . $_REQUEST[ "JC_table" ] ] == "ASC" ? "checked" : "" ?>
				/> ASC<br class="form" />

				<input
					type	= "radio"
					name	= "JC_filter_OT"
					value	= "DESC"
					onclick	= "JC_session( 'JC_filter_OT_<?= $_REQUEST[ "JC_table" ] ?>', this.value );"
					<?= $_SESSION[ "JC_filter_OT_" . $_REQUEST[ "JC_table" ] ] == "DESC" ? "checked" : "" ?>
				/> DESC

			</td>
			<td>

				<a href="#this" title="First Page"

					<? if( $JC_page && $_SESSION[ "JC_filter_page_" . $_REQUEST[ "JC_table" ] ] != 1 ) { ?>

						onclick="
							document.getElementById( 'JC_filter_page' ).value = '1';
							document.getElementById( 'JC_filter_page' ).focus( );
						"

					<? } ?>

				>◀</a>

				<a href="#this" title="Previous Page"

					<? if( $JC_page && $_SESSION[ "JC_filter_page_" . $_REQUEST[ "JC_table" ] ] != 1 ) { ?>

						onclick="
							document.getElementById( 'JC_filter_page' ).value = ( parseInt( document.getElementById( 'JC_filter_page' ).value ) > 1 ? parseInt( document.getElementById( 'JC_filter_page' ).value ) - 1 : '1' );
							document.getElementById( 'JC_filter_page' ).focus( );
						"

					<? } ?>

				>◁</a>

				<input
					type	= "text"
					id		= "JC_filter_page"
					value	= "<?= $JC_page ? $_SESSION[ "JC_filter_page_" . $_REQUEST[ "JC_table" ] ] : 0 ?>"
					size	= "4"
					title	= "Current Page"
					class	= "right"
					onclick	= "this.select( );"
					onfocus	= "this.select( );"
					onblur	= "JC_session( 'JC_filter_page_<?= $_REQUEST[ "JC_table" ] ?>', this.value );"				
				/> / <span title="Total Page" class="help"><?= $JC_page ?></span>

				<a href="#this" title="Next Page"

					<? if( $JC_page && $_SESSION[ "JC_filter_page_" . $_REQUEST[ "JC_table" ] ] != $JC_page ) { ?>

						onclick="
							document.getElementById( 'JC_filter_page' ).value = ( parseInt( document.getElementById( 'JC_filter_page' ).value ) < <?= $JC_page ?> ? parseInt( document.getElementById( 'JC_filter_page' ).value ) + 1 : '<?= $JC_page ?>' );
							document.getElementById( 'JC_filter_page' ).focus( );
						"

					<? } ?>
				>▷</a>

				<a href="#this" title="Last Page"

					<? if( $JC_page && $_SESSION[ "JC_filter_page_" . $_REQUEST[ "JC_table" ] ] != $JC_page ) { ?>

						onclick="
							document.getElementById( 'JC_filter_page' ).value = '<?= $JC_page ?>';
							document.getElementById( 'JC_filter_page' ).focus( );
						"

					<? } ?>

				>▶</a>

			</td>

			<td>
				<input
					type	= "text"
					value	= "<?= $_SESSION[ "JC_filter_limit_" . $_REQUEST[ "JC_table" ] ] ?>"
					size	= "4"
					class	= "right"
					onclick	= "this.select( );"
					onblur	= "JC_session( 'JC_filter_limit_<?= $_REQUEST[ "JC_table" ] ?>', this.value );"
				/>
			</td>

			<td><a href="#this" class="form" onclick="location.reload( );">Select</a></td>

			<? if( $_REQUEST[ "JC_mode" ] == "select" ) { ?><td><a href="" target="_blank" class="form" onclick="">Excel</a></td><? } ?>

		</tr>

	</table><hr/>

<? } ?>
